<template>
	<view>
		<header-top :messageInfo="{typeFlag:true,message:'添加应用',liner:false}">
			<view class="rightmsg" slot="rightmsg">
				<view class="rightmsg_content flexleft">
					<view class="nostrongtext" style="color: #0BBDCB;" @click="localbc">确定</view>
				</view>
			</view>
		</header-top>
		<view class="header_one">
			<!-- 基本资料 -->
			<view class="strongtext margin_top"  v-show="information.length">
				<text class="titletext textliner">基本资料</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in information" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
			<!-- 采购管理 -->
			<view class="strongtext margin_top"  v-show="supplyinfo.length">
				<text class="titletext textliner">采购管理</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in supplyinfo" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
			<!-- 销售管理 -->
			<view class="strongtext margin_top"  v-show="salesinfo.length">
				<text class="titletext textliner">销售管理</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in salesinfo" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
			<!-- 考勤管理 -->
			<view class="strongtext margin_top"  v-show="kaoqingl.length">
				<text class="titletext textliner">考勤管理</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in kaoqingl" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
			<!-- 库存管理 -->
			<view class="strongtext margin_top"   v-show="Inventoryinfo.length">
				<text class="titletext textliner">库存管理</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in Inventoryinfo" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
			<!-- 财务管理 -->
			<view class="strongtext margin_top"   v-show="financialinfo.length">
				<text class="titletext textliner">财务管理</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in financialinfo" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
			<!-- 经营分析 -->
			<view class="strongtext margin_top"  v-show="analysis.length">
				<text class="titletext textliner">经营分析</text>
			</view>
			<view class="jibenzl flexbetween" v-for="(item,index) in analysis" @click="onClick(item)">
				<view class="jibenleft flexaround">
					<view class="workimage">
						<image :src="item.Image" mode=""></image>
					</view>
					<view class="worktext">{{item.text}}</view>
				</view>
				<view class="greenyes" v-show="item.state == true"></view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				// 基本资料
				information: [],
				// 采购管理
				supplyinfo: [],
				// 销售管理
				salesinfo: [],
				kaoqingl: [],
				// 库存管理
				Inventoryinfo: [],
				// 财务管理
				financialinfo: [],
				// 经营分析
				analysis: [],
			}
		},
		onLoad() {
		},
		onShow() {
			this.kaoqingl = JSON.parse(uni.getStorageSync("kaoqingl"))
			this.Inventoryinfo = JSON.parse(uni.getStorageSync("Inventoryinfo"))
			this.financialinfo = JSON.parse(uni.getStorageSync("financialinfo"))
			this.supplyinfo = JSON.parse(uni.getStorageSync("supplyinfo"))
			this.salesinfo = JSON.parse(uni.getStorageSync("salesinfo"))
			this.information = JSON.parse(uni.getStorageSync("information"))
			this.analysis = JSON.parse(uni.getStorageSync("analysis"))
		},
		methods: {
			localbc() {
				uni.setStorageSync("financialinfo",JSON.stringify(this.financialinfo))
				uni.setStorageSync("Inventoryinfo",JSON.stringify(this.Inventoryinfo))
				uni.setStorageSync("kaoqingl",JSON.stringify(this.kaoqingl))
				uni.setStorageSync("salesinfo",JSON.stringify(this.salesinfo))
				uni.setStorageSync("supplyinfo",JSON.stringify(this.supplyinfo))
				uni.setStorageSync("information",JSON.stringify(this.information))
				uni.setStorageSync("analysis",JSON.stringify(this.analysis))
				uni.navigateBack(1)
			},
			onClick(item) {
				item.state = !item.state;
				// console.log('发送参数');
				// uni.$emit("isShow",item);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.worktext {
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
		text-align: center;
	}

	.header_one {
		margin: 30rpx;
		background-color: #fff;
		border-radius: 30rpx;

		.jibenzl {
			padding: 20rpx 30rpx;

			.jibenleft {
				.worktext {
					font-size: 30rpx;
					font-family: PingFang SC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
					margin-left: 20rpx;
				}
			}
		}
	}

	.workimage {
		width: 84rpx;
		height: 84rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.bigbox {
		flex-wrap: wrap;
		padding: 0 10rpx 30rpx 10rpx;
	}

	.itembox {
		width: 25%;
	}

	.tabbarpad {
		padding: 0 30rpx 160rpx 30rpx;
	}
</style>
